<template>
    <Layout class="p-5 bg-white">
        <Form class="p-5" :model="depositBackRequestMain" :label-width="130">								
					<FormItem class="w-50" label="退押申请编号">
						<label>: {{depositBackRequestMain.backId}}</label>
					</FormItem>			
					<FormItem class="w-50" label="客户名">
						<label>: {{client.clientName}}</label>
					</FormItem>
					<FormItem class="w-50" label="创建时间">
						<label>: {{depositBackRequestMain.ct}}</label>
					</FormItem>
					<FormItem class="w-50" label="金额">
						<label>: {{depositBackRequestMain.amount}}</label>
					</FormItem>
					<FormItem class="w-50" label="门店">
						<label>: {{store.name}}</label>
					</FormItem>
					<FormItem class="w-50" label="操作时间">
						<label>:{{depositBackRequestMain.ut}}</label>
					</FormItem>
					
					<FormItem class="w-50" label="申请状态">
						<label v-if="this.depositBackRequestMain.statu=='REQ'">: 已申请</label>
						<label v-else-if="this.depositBackRequestMain.statu=='REJ'">: 已驳回</label>
						<label v-else="this.depositBackRequestMain.statu=='BCK'">: 已退还</label>
					</FormItem>
					<FormItem class="w-50" label="原因">
						<label>: {{depositBackRequestMain.reason}}</label>
					</FormItem>	                     
			<FormItem>
			    <Button @click="cancel" style="margin-left: 1px">取消</Button>
			</FormItem>
        </Form>
    </Layout>
</template>
<script>
    export default {
        data() {
            return {
				client:{},
				store:{},
                depositBackRequestMain: {
					backId:'',					
					ct:'',
					amount:'',				
					ut:'',
					statu:'',
					reason:'',
					uu:'',
                },			
				statu:[
					{
						value: 'REQ',
						label: '已申请'
					},
					{
						value: 'REJ',
						label: '已驳回'
					},
					{
						value: 'BCK',
						label: '已退还'
					},
				],
				currentUser: {
				},
				flag:true
            }
        },
        methods: {		
            cancel: function () {
                this.$tabs.close();
            },
            init: function () {
                this.search();
            },
            search: function () {
                let self = this;
                this.http.get({
                    url: "/client/deposit-back-request/info",
                    param: {
                        backId: this.$data.depositBackRequestMain.backId
                    }
                }).then(data => {
					data.deposit_back_request.ct = data.deposit_back_request.ct.replace('T',' ');
					if(null != data.deposit_back_request.ut){
					data.deposit_back_request.ut = data.deposit_back_request.ut.replace('T',' ');	
					}
					this.$data.depositBackRequestMain = data.deposit_back_request;
					this.$data.client = data.client;
					this.$data.store = data.store;
					this.$data.depositBackRequestMain.amount = data.deposit_back_request.amount/100;
                });				
            },
        },
        created: function () {
			this.$data.depositBackRequestMain.backId = this.$route.params.backId;			
			this.init();
			this.search();			
        },
        mounted: function () {		
			
        },
		computed: {
			current: function() {				
				this.$data.depositBackRequestMain.uu = store.state.currentUser.user.userId;				
				return store.state.currentUser;
			}
		}
    }
</script>

<style>
</style>
